package com.beta.restapi.internal.auth;

import com.beta.em.UserType;

/**
 * Created by vector on 2016/11/19.
 */
public class AuthResult {

    private String token;

    private UserType userType;

    private Object subject;

    public AuthResult(String token, UserType userType, Object subject) {
        this.token = token;
        this.userType = userType;
        this.subject = subject;
    }

    /**
     * @return the token
     */
    public String getToken() {
        return token;
    }

    /**
     * @param token the token to set
     */
    public void setToken(String token) {
        this.token = token;
    }

    /**
     * 获得登录用户
     * @param <T>
     * @return
     */
    @SuppressWarnings("unchecked")
    public <T> T getSubject() {
       return (T) this.subject;
    }

    public UserType getUserType() {
        return this.userType;
    }

}
